package com.aop1;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.stereotype.Component;

@Component("myAspect")
public class MyAspect implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        System.out.println("权限处理通关");
        long preTime = System.currentTimeMillis();
        Object obj = methodInvocation.proceed();
        long aftTime = System.currentTimeMillis();
        System.out.println("耗费时间：" + (aftTime - preTime));
        return obj;
    }
}
